Skip to content

Conversation

@drewcassidy
Copy link
Member

@drewcassidy drewcassidy commented Oct 28, 2025

This is a breaking change (so the version would change to 1.0.0).

Docs build for this branch: https://kspbuildtools.readthedocs.io/en/next/

The goals here were:

  • eliminating the double-import of the .csproj.user file. Instead, this branch means that the path to KSP root never gets referenced in the user .csproj at all, allowing all the path determination to be calculated at runtime
  • eliminating risk of namespace-collision with other frameworks for property names
  • allowing toggling each component of KSPBT, to account for weird use cases, such as...
  • allowing building mods for use in the Unity editor, such as UI code, by automatically disabling all the references that are unsafe there. Its up to the mod developer still to set up preprocessor directives and includes to allow compilation in this situation, but it eliminates any need for keeping code the same between the main mod codebase and "stub" cs files just to get serialization working

Changelog:

Msbuild

  • Renamed global msbuild properties to have the KSPBT_ prefix to avoid namespace collisions with other frameworks
    • KSPRoot is now KSPBT_GameRoot. It should no longer be referenced within a .csproj file
    • RepoRootPath is now KSPBT_ModRoot, and should now point to the mod folder within GameData rather than the
      root of a git repo
    • BinariesOutputRelativePath is now KSPBT_ModPluginFolder
    • GenerateKSPAssemblyAttribute is now KSPBT_GenerateAssemblyAttribute and defaults to true
    • GenerateKSPAssemblyDependencyAttributes is now KSPBT_GenerateDependencyAttributes and defaults to true
    • ReferenceUnityAssemblies is now KSPBT_ReferenceUnityAssemblies
    • ReferenceKSPAssemblies is now KSPBT_ReferenceGameAssemblies
  • Added the KSPBT_ReferenceSystemAssemblies property to control referencing the mono system DLLs within the KSP
    managed folder. Setting this property to false will load the implicit framework DLLs instead.
  • Mod dependencies should now be declared with
    ModReference items. This avoids the need for the KSP install path to be known at evaluation time.
  • Fix KSP_VERSION_MAX getting mangled when using an existing version file (Version file generation is adding extra single quotes on KSP_Version_Max #64)
  • Fix incorrect behavior when building without a solution (KSPCommon.Props: Don't depend on $(SolutionDir) and $(SolutionName) for default property values (they don't exist if you don't have a sln file) #50)

Actions

  • KSPBT actions used in reusable workflows are now pinned with each tag, instead of using actions from main. All calls to reusable workflows should be pinned to a tag to ensure the correct actions are being used. (Find a way to pin workflow/action versions #21)
  • compile action: Use dotnet restore instead of nuget restore by default, allowing the action to work on any Ubuntu runner image. Added the use-nuget-restore option to restore the previous behavior for projects that use packages.config for dependencies. (Re-enable support for packages.config style projects in next #68)
  • compile action: Removed call toactions/setup-dotnet. Setting up .NET should be done as a separate step. (Proposal: Drop setup-dotnet from compile action #65)
  • setup-ckan action: Sped up execution by skipping recommended packages and man-db updates
  • setup-ckan action: Add ckan-install-method option for installation method. Currently supports 'apt' for installation on Debian/Ubuntu, or 'skip' to skip installation for runners that already have CKAN installed.
  • assemble-release action: outputs.artifact-path was split into outputs.artifact-zip-path and outputs.artifact-dir-path containing paths to a zip file and directory respectively. These are also now located under $RELEASE_STAGING instead of inside the workspace
  • assemble-release action: Removed call to actions/upload-artifact. This should be done as a separate step.

Library

  • Removed Log.cs and the entire includes directory. Please use KSPCommunityLib instead.

# Conflicts:
#	CHANGELOG.md
allows for skipping installation entirely, as well as supporting non-debian-based operating systems in the future.
### Msbuild

- Renamed global msbuild properties to have the `KSPBT_` prefix to avoid namespace collisions with other frameworks
  - `KSPRoot` is now `KSPBT_GameRoot`. It should no longer be referenced within a .csproj file
  - `RepoRootPath` is now `KSPBT_ModRoot`, and should now point to the mod folder within GameData rather than the
    root of a git repo
  - `BinariesOutputRelativePath` is now `KSPBT_ModPluginFolder`
  - `GenerateKSPAssemblyAttribute` is now `KSPBT_GenerateAssemblyAttribute` and defaults to true
  - `GenerateKSPAssemblyDependencyAttributes` is now `KSPBT_GenerateDependencyAttributes` and defaults to true
  - `ReferenceUnityAssemblies` is now `KSPBT_ReferenceUnityAssemblies`
  - `ReferenceKSPAssemblies` is now `KSPBT_ReferenceGameAssemblies`
- Added the `KSPBT_ReferenceSystemAssemblies` property to control referencing the mono system DLLs within the KSP
  managed folder. Setting this property to false will load the implicit framework DLLs instead.
- Mod dependencies should now be declared with
  `ModReference` items. This avoids the need for the KSP install path to be known at evaluation time.
- Only include Log.cs (or anything else in include/unity) when `KSPBT_ReferenceUnityAssemblies` is `true` (#61)
- Fix `KSP_VERSION_MAX` getting mangled when using an existing version file (#64)
- Fix incorrect behavior when building without a solution (#50)

### Actions

- KSPBT actions used in reusable workflows are now pinned with each tag, instead of using actions from `main`. All calls to reusable workflows should be pinned to a tag to ensure the correct actions are being used. (#21)
- `compile` action: Use `dotnet restore` instead of `nuget restore` by default, allowing the action to work on any Ubuntu runner image. Added the `use-nuget-restore` option to restore the previous behavior for projects that use packages.config for dependencies. (#68)
- `compile` action: Removed call to`actions/setup-dotnet`. Setting up .NET should be done as a separate step. (#65)
- `setup-ckan` action: Sped up execution by skipping recommended packages and man-db updates
- `setup-ckan` action: Add `ckan-install-method` option for installation method. Currently supports `'apt'` for installation on Debian/Ubuntu, or `'skip'` to skip installation for runners that already have CKAN installed.
- `assemble-release` action: `outputs.artifact-path` now includes the `.zip` extension (#51)
@drewcassidy drewcassidy merged commit c72a7d1 into main Nov 20, 2025
17 checks passed
@drewcassidy drewcassidy deleted the next branch November 20, 2025 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants